package wsdc.app.main.v1;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.File;

@Setter
@Getter
@Component
@ConfigurationProperties(prefix = "cert")
public class CertConfig {
    private int proxyPort = 31995;
    private String dir;

    public CertConfig() {
        //  处理好基础工作目录
        File f = new File("/usr");
        if(f.exists()){
            dir = "/cert";
        }else{
            dir = "D:\\cert";
        }

        File f1 = new File(dir);
        if(!f1.exists()){
            f1.mkdir();
        }
    }
}
